<link type="text/css" rel="stylesheet" href="{url:#css/ucenter.css}" />
{echo:JS::import('form');}
{echo:JS::import('date');}
{echo:JS::import('dialog?skin=tinysimple');}
<script type="text/javascript" charset="UTF-8" src="{url:#js/jquery.iframe-post-form.js}"></script>
<div class="container clearfix">
    {widget:name=sub_navs action=ucsidebar sidebar=$sidebar act=$actionId}
    <div class="content clearfix uc-content">
        <h1 class="title"><span>积分复投：</span></h1>
        <!--
        <span>推广连接：<a target="blank" href="{url:/simple/reg/num/$user[number]}">
            http://www.ahcysc.com/index.php?con=simple&act=reg&num={$user[number]}
            </a><label style="font-size:12px;">(右键复制链接地址)</label>
            </span>
            <br>
            <span>
                {set:$url=urlencode(Common::get_complete_path("/simple/reg/num/$user[number]"))}
                <img src="{url:/simple/get_qrcode_img_by_url/url/$url}"/>
            </span>
        -->

        {if:isset($msg)}
        <div class="message_{$msg[0]} ie6png">{$msg[1]}</div>
        {elseif:isset($validator)}
        <div class="message_warning ie6png">{$validator['msg']}</div>
        {/if}

        <!--<table border="0">-->
            <!--<tr>-->
                <!--<td>-->
                    <!--分享连接：<a target="blank" href="{url:/simple/reg/num/$user[number]}">-->
                        <!--http://www.ahcysc.com/index.php?con=simple&act=reg&num={$user[number]}-->
                    <!--</a><label style="font-size:12px;">(右键复制链接地址)</label>-->
                <!--</td>-->
            <!--</tr>-->
            <!--<tr>-->
                <!--<td>-->
                    <!--{set:$url=urlencode(Common::get_complete_path("/simple/reg/num/$user[number]"))}-->
                    <!--<img src="{url:/simple/get_qrcode_img_by_url/url/$url}"/>-->
              <!---->
                <!--</td>-->
            <!--</tr>-->
            <!--<tr>-->
                <!--<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>扫一扫 二维码</span></td>-->
            <!--</tr>-->
        <!--</table>-->


        <div class="mt10" style="position:relative;margin-left:100px;">
            <div>
                <span style="margin-left: 90px;font-size: 16px;font-weight: 800">现金分余额: ({$result['xjf']})</span>&nbsp;&nbsp;&nbsp;&nbsp;
                <span style="font-size: 16px; font-weight: 800">注册分余额: ({$result['zcf']})</span>
            </div>
            <form id="info-form" class="simple" action="{url:/ucenter/repeat_invest_act}" method="post">
                <table class="form">
                    <!-- <tr><td class="label">会员帐号：</td><td>{if:Validator::match('\d+@no.com',$info['email'])}<input type="text" pattern="email" name="email" value="{$email}" alt="邮箱格式错误"> <label></label>{else:}{$email}{/if}</td></tr> -->
                    <!-- <tr><td class="label">会员级别：</td><td>{$gname|'默认分组'}</td></tr> -->
                    <!--<tr>-->
                        <!--<td class="label">推荐人：</td><td>-->
                            <!--<input type="text" pattern="required" id="tjr_name" name="tjr_name"  value="" alt="推荐人不能为空">-->
                        <!--</td>-->
                    <!--</tr>-->
                    <!--<tr>-->
                        <!--<td class="label">用户名：</td><td>-->
                            <!--<input type="text" pattern="required" name="uname" id="uname" value="" alt="用户名不能为空">-->
                        <!--</td>-->
                    <!--</tr>-->
                    <!--<tr>-->
                        <!--<td class="label">登录密码：</td><td><input placeholder='6-20位字母数字组合' type="password" pattern="required" id="password" name="password" minlen="6" maxlen="20" value="" alt="密码长度为6-20位"> <label></label></td>-->
                    <!--</tr>-->
                    <tr>
                        <td class="label">
                            复投方式:&nbsp;
                        </td>
                        <td>
                            <select name="method" id="method" pattern="required" alt="请选择类别" style="width:207px;">
                                <option value="">请选择复投方式</option>
                                <option value="1">(100%)现金分复投</option>
                                <option value="2">(80%)现金分+(20%)注册分复投</option>
                            </select>
                            <!--<div style="margin-top: 30px"><input type="radio" name="method" id="method">(100%)现金分复投</div>-->
                            <!--<br>-->
                            <!--<input type="radio" name="method" >(50%)现金分+(50%)注册分复投-->
                        </td>
                    </tr>
                    <tr>
                        <td class="label">复投级别：</td>
                        <td>
                            <select pattern="required" name="agent" id="proxy_type" alt="请选择类别" style="width:210px;">
                                <option value="">请选择复投级别</option>
                                {query:name=grade}
                                <option value="{$item['id']}">{$item['money']} 元</option>
                                {/query}
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">交易密码：</td><td><input placeholder='6-20位字母数字组合' type="password" pattern="required" name="passwordtwo" id="passwordtwo" minlen="6" maxlen="20" value="" alt="密码长度为6-20位"> <label></label></td>
                    </tr>

                    <!--<tr>-->
                        <!--<td class="label"></td>-->
                        <!--<td>-->
                            <!--<select  id="province" name ="province">-->
                                <!--<option value="0">==省份/直辖市==</option>-->
                                <!--{query:name=area  where=parent_id eq 0}-->
                                <!--<option value="{$item['id']}">{$item['name']}</option>-->
                                <!--{/query}-->
                            <!--</select>-->
                            <!--<select id="city" name="city">-->
                                <!--<option value="0">==市==</option>-->
                            <!--</select>-->
                            <!--<select id="county" name="county">-->
                                <!--<option value="0">==县/区==</option>-->
                            <!--</select>-->
                        <!--</td>-->
                    <!--</tr>-->
                    <!--<tr>-->
                    <!--<td class="label">短信验证码：</td>-->
                    <!--<td>-->
                    <!--{if:Validator::mobi($info['mobile'])}{$mobile}{else:}-->
                    <!--<input type="text" pattern="\d{6}" name="validate_code" id="validate_code" value="" alt="短信验证码为6为数字"><label></label>{/if}-->
                    <!--<input type="button" value="获取短信验证码" class="btn btn-main" onclick="get_validate_code()"/>-->
                    <!--</td>-->
                    <!--</tr>-->

                    <tr>
                        <td colspan="2" class="tc"><input type="submit" class="btn btn-main" value="提交"></td>
                    </tr>
                </table>
                {token:key=reg}
            </form>
        </div>
    </div>
</div>
<div id="head-dialog" style="display: none">
    <div class="box" style="width:400px;">
        <h2>上传头像：</h2>
        <div class="content mt20 p10">
            <form enctype="multipart/form-data" action="{url:/ucenter/upload_head}" method="post"  id="uploadForm">
                <p><input type="file" name="imgFile" ></p>
                <p class="mt20 tc"><button class="btn" id="upload-btn">上传</button></p>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
    $("#upload-link").on("click",function (){
        art.dialog({id:'head-dialog',content:document.getElementById('head-dialog'),lock:true});
    });

    $("#uploadForm").iframePostForm({
        iframeID: 'iframe-post-form',
        json:true,
        post: function(){
            $("#upload-btn").text("上传中...")
        },
        complete: function(data){
            if(data['error']==1){
                alert(data['message']);
            }else{
                var root_url = "{url:@}"
                $("#head-pic").attr("src",root_url+data['url']+'?i='+Math.random());
                art.dialog({id:'head-dialog'}).close();
            }
            $("#upload-btn").text("上传");
        }

    });

    var form =  new Form('info-form');
    form.setValue('is_default','{$is_default}');
    $("#areas").Linkage({ url:"{url:/ajax/area_data}",selected:[{$province|0},{$city|0},{$county|0}],callback:function(data){
        var text = new Array();
        var value = new Array();
        for(i in data[0]){
            if(data[0][i]!=0){
                text.push(data[1][i]);
                value.push(data[0][i]);
            }
        }
        $("#test").val(value.join(','));
        FireEvent(document.getElementById("test"),"change");
    }});
    {if:isset($invalid)}
    autoValidate.showMsg({id:$("input[name='{$invalid['name']}']").get(0),error:true,msg:'{$invalid['msg']}'});

    {/if}


    function get_validate_code()
    {
        var mobile = $.trim($("#uname").val());
        if(mobile == '')
        {
            alert('手机号码不能为空');
            return;
        }
        var mobile_pattern = /^((1[3-9]\d{9})|(\d{14}))$/;
        if(!mobile_pattern.test(mobile))
        {
            alert('手机号码不合法');
            return;
        }

        $("#btn_get_validate").attr("disabled", true);
        $.post("{url:/simple/sms_send}",{mobile:mobile},function(result){
            alert(result);
            $("#btn_get_validate").attr("disabled", false);
        });
    }

</script>
<script type="text/javascript">
    $('#proxy_type').change(function(){
        $("#province").removeAttr('disabled');
        $("#city").removeAttr('disabled');
        $("#county").removeAttr('disabled');

        var u_lx = $(this).val();
        if (u_lx == 1 || u_lx == 2) {
            $("#province").attr('disabled',true).val(0);
            $("#city").attr('disabled',true).val(0);
            $("#county").attr('disabled',true).val(0);
        } else if (u_lx == 4) {
            $("#county").attr('disabled',true).val(0);
        }
    });


    $(function(){
        $("#province").change(function(){
            var id = $(this).val();

            if(id == 0)
            {
                $("#city").html("<option value='0'>==市==</option>");
                $("#county").html("<option value='0'>==县/区==</option>");
            }
            else
            {
                $.post("{url:/uncent/transform}",{id:id},function(data){
                    $("#city").html("<option value='0'>==市==</option>");
                    $("#county").html("<option value='0'>==县/区==</option>");
                    $("#city").append(data);
                },'text');
            }

        });

        $("#city").change(function(){
            var id = $(this).val();
            if(id == 0)
            {
                $("#county").html("<option value='0'>==县/区==</option>");
            }
            else
            {
                $.post("{url:/uncent/transform}",{id:id},function(data){
                    $("#county").html("<option value='0'>==县/区==</option>");
                    $("#county").append(data);
                },'text');

            }

        })

    });
</script>
<!--<script type="text/javascript">-->
<!--{if:!empty($invalid)}-->
<!--$("#div_msg").text("{$invalid[msg]}")-->
<!--{/if}-->

<!--function show_msg( msg )-->
<!--{-->
<!--$("#div_msg").text(msg);-->
<!--setTimeout(function(){-->
<!--$("#div_msg").text('');-->
<!--},3000);-->
<!--}-->
<!--</script>-->
